package com.logistics.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.logistics.mapper.EmployeeMapper;
import com.logistics.pojo.Employee;
import com.logistics.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 服务实现层
 * @author Administrator
 *
 */
@Service
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper, Employee> implements EmployeeService {

    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public Map<Integer, List<Employee>> findEmpBySid(List<String> idsList) {

        Map<Integer, List<Employee>> returnMap = new HashMap<Integer, List<Employee>>();

        idsList.forEach(sid -> {
            QueryWrapper<Employee> queryWrapper = new QueryWrapper<Employee>();
            queryWrapper.eq("sid",sid);
            List<Employee> employeeList = employeeMapper.selectList(queryWrapper);
            returnMap.put(Integer.valueOf(sid),employeeList);
        });

        return returnMap;
    }
}
